package xkp.lesson1;

public class Person {
	//成员变量如果不初始化，则自动会把默认值给成员变量
	//所有的引用数据类型默认值为null
	public static Integer count = 0;
	static {
		System.out.println("我是Person静态代码块，我在Person或者Person子类被加载时调用");
	}
	
	private int age;
	private String name;
	
	public Person() {
		System.out.println("Person()");
	}
	
	private Person(int age) {
		System.out.println("Person(int age)");
		this.age = age;
	}
	
	public Person(int age, String name) {
		System.out.println("Person(int age, String name)");
		this.age = age;
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String toString() {
		return "Person [age=" + age + ", name=" + name + "]";
	}
	
	
	public static void fun1() {
		System.out.println("fun1...我是static修饰的方法");
	}
	
	public  void fun1(String name) {
		System.out.println("fun1..."+name);
	}
}
